
import { List_ADD } from '../actionTypes'

import axios from 'axios'

// export const todoDELActions = (dispatch, payload) => dispatch({ type: TODO_DEL, payload })

export const listAddActions = (val) => {
    //  dispatch 自动传递过来了
    return async (dispatch, stateList) => {
        console.log(dispatch, 'dispatch')

        console.log(stateList, 'stateList')

        let { data } = await axios.get('http://localhost:3000/assets')
        console.log(data)

        dispatch({ type: List_ADD, payload: data, val: val })

    }

}
